<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui">
<h:head>
    <link href="../../css/component.css" rel="stylesheet" type="text/css"/>
</h:head>

<!-- <ui:param name="bean" value="#{biMonitorConfigAction}" /> -->
<h:body>

    <span class="pagetitle">告警管理—— 每日报表配置</span>
    <p:separator/>
    <h:form id="fsearch">
        <p:growl id="growl" showDetail="true" sticky="false" life="1000"/>
        <p:panel id="panel0" header="查询添加" style="margin-bottom:10px;">
            <p:dataTable id="dlist0" var="l" resizableColumns="true"
                         value="#{dailyReportConfigAction.entityDaliyReport}">

                <p:column headerText="监控语句 (服务器ID-最大值-最小值-玩家总数)" style="width:400px">
                    <p:inputTextarea value="#{l.inquerySQLOne}" styleClass="fullwidth" style="height: 80px;"/>
                </p:column>
                <p:column headerText="监控语句 (超出阀值玩家数)" style="width:400px">
                    <p:inputTextarea value="#{l.inquerySQLTwo}" styleClass="fullwidth" style="height: 80px;"/>
                </p:column>
                <p:column headerText="监控阈值" style="width:120px">
                    <h:inputText value="#{l.threshHold}" styleClass="fullwidth"/>
                </p:column>
                <p:column headerText="监控描述" style="width:200px">
                    <h:inputText value="#{l.description}" styleClass="fullwidth"/>
                </p:column>

                <p:column headerText="操作" styleClass="column" style="width:200px">
                    <p:commandButton value="查询"
                                     action="#{dailyReportConfigAction.searchByCriteria()}"
                                     update=":datalist:panel1"/>
                    &#160;
                    <p:commandButton value="添加"
                                     action="#{dailyReportConfigAction.addEntityDaliyReport()}"
                                     update=":datalist:panel1 :fsearch:growl"/>
                </p:column>
            </p:dataTable>
        </p:panel>
    </h:form>
    <br/>
    <h:form id="datalist">
        <p:growl id="growl1" showDetail="true" sticky="false" life="1000"/>
        <p:panel id="panel1" header="监控展示" style="margin-bottom:10px;">
            <p:outputLabel value="测试日期:" style="font-weight: bold; font-size: 14px"/> &#160; <p:calendar
                value="#{dailyReportConfigAction.testDate}" mode="popup" pattern="yyyy-MM-dd"/>&#160;
            <p:commandButton value="测试" action="#{dailyReportConfigAction.test()}" update=":datalist"
                             style="height: 28px; margin-bottom: 6px"/>
            <p:dataTable id="dlist" var="l"
                         value="#{dailyReportConfigAction.entityDaliyReportList}"
                         resizableColumns="true" paginator="true" paginatorPosition="top" scrollable="true"
                         paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                         rowsPerPageTemplate="15,30" rows="15" style="text-align:center;">
                <p:column headerText="监控语句 (服务器ID-最大值-最小值-玩家总数)" style="width:400px">
                    <p:inputTextarea value="#{l.inquerySQLOne}" style="height:30px;" onblur="
                            this.style = 'height:30px;';"
                                     onfocus=" this.style = 'height:auto;';" styleClass="fullwidth"/>
                </p:column>
                <p:column headerText="监控语句 (超出阀值玩家数)" style="width:400px">
                    <p:inputTextarea value="#{l.inquerySQLTwo}" style="height:30px;" onblur="
                            this.style = 'height:30px;';"
                                     onfocus=" this.style = 'height:auto;';" styleClass="fullwidth"/>
                </p:column>
                <p:column headerText="监控阈值" style="width:120px">
                    <h:inputText value="#{l.threshHold}" styleClass="fullwidth"/>
                </p:column>
                <p:column headerText="监控描述" style="width:200px">
                    <h:inputText value="#{l.description}" styleClass="fullwidth"/>
                </p:column>

                <p:column headerText="操作" styleClass="column" style="width:200px">
                    <p:commandButton value="修改"
                                     action="#{dailyReportConfigAction.modifyEntityDaliyReport(l)}"
                                     update=":datalist"/>
                    &#160;
                    <p:commandButton value="删除"
                                     action="#{dailyReportConfigAction.delEntityDaliyReport(l.id)}"
                                     update=":datalist"/>
                </p:column>
            </p:dataTable>
        </p:panel>
    </h:form>
</h:body>
</html>
